package com.ruoyi.cost.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cost.mapper.CostRechargeInfoMapper;
import com.ruoyi.cost.domain.CostRechargeInfo;
import com.ruoyi.cost.service.ICostRechargeInfoService;

/**
 * 充值记录Service业务层处理
 * 
 * @author zomcx
 * @date 2025-06-12
 */
@Service
public class CostRechargeInfoServiceImpl implements ICostRechargeInfoService 
{
    @Autowired
    private CostRechargeInfoMapper costRechargeInfoMapper;

    /**
     * 查询充值记录
     * 
     * @param costRechargeId 充值记录主键
     * @return 充值记录
     */
    @Override
    public CostRechargeInfo selectCostRechargeInfoByCostRechargeId(Long costRechargeId)
    {
        return costRechargeInfoMapper.selectCostRechargeInfoByCostRechargeId(costRechargeId);
    }

    /**
     * 查询充值记录列表
     * 
     * @param costRechargeInfo 充值记录
     * @return 充值记录
     */
    @Override
    public List<CostRechargeInfo> selectCostRechargeInfoList(CostRechargeInfo costRechargeInfo)
    {
        return costRechargeInfoMapper.selectCostRechargeInfoList(costRechargeInfo);
    }

    /**
     * 新增充值记录
     * 
     * @param costRechargeInfo 充值记录
     * @return 结果
     */
    @Override
    public int insertCostRechargeInfo(CostRechargeInfo costRechargeInfo)
    {
        costRechargeInfo.setCreateTime(DateUtils.getNowDate());
        return costRechargeInfoMapper.insertCostRechargeInfo(costRechargeInfo);
    }

    /**
     * 修改充值记录
     * 
     * @param costRechargeInfo 充值记录
     * @return 结果
     */
    @Override
    public int updateCostRechargeInfo(CostRechargeInfo costRechargeInfo)
    {
        costRechargeInfo.setUpdateTime(DateUtils.getNowDate());
        return costRechargeInfoMapper.updateCostRechargeInfo(costRechargeInfo);
    }

    /**
     * 批量删除充值记录
     * 
     * @param costRechargeIds 需要删除的充值记录主键
     * @return 结果
     */
    @Override
    public int deleteCostRechargeInfoByCostRechargeIds(Long[] costRechargeIds)
    {
        return costRechargeInfoMapper.deleteCostRechargeInfoByCostRechargeIds(costRechargeIds);
    }

    /**
     * 删除充值记录信息
     * 
     * @param costRechargeId 充值记录主键
     * @return 结果
     */
    @Override
    public int deleteCostRechargeInfoByCostRechargeId(Long costRechargeId)
    {
        return costRechargeInfoMapper.deleteCostRechargeInfoByCostRechargeId(costRechargeId);
    }
}
